﻿using CGT.GOP.Common;
using CGT.Infrastructure.Entity;
using CGT.Infrastructure.Service;
using Dapper.Extensions;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace CGT.GOP.Controllers
{
    public class BlackListIPController : BaseController
    {
        GovBlackListIPService blService = new GovBlackListIPService();  //黑名单IP

        // GET: BlackListIP
        [AllowAnonymous]
        public ActionResult Index()
        {
            return View();
        }

        /// <summary>
        /// 分页查询
        /// </summary>
        /// <returns></returns>
        [AllowAnonymous]
        public ContentResult GetPage()
        {
            int pageIndex = GetPageIndex();
            int pageSize = GetPageSize();
            string ip = GetParam("IP");
            Page<GovBlackListIP> page= blService.GetPages(pageIndex, pageSize, ip);
            return ReturnResult(new ResultPageData<List<GovBlackListIP>>
            {
                data = page.rows,
                total = page.total
            });
        }
    }
}